package com.jmemoir.mq.rabbitmq.listener;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 简单模型-work
 *
 * @author Tellsea
 * @date 2023/9/5
 */
@Component
public class WorkListener {

    @RabbitListener(queuesToDeclare = @Queue("spring.work.queue"))
    public void listener(String msg) {
        System.out.println("WorkListener listener 接收到消息：" + msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("spring.work.queue"))
    public void listener2(String msg) {
        System.out.println("WorkListener listener2 接收到消息：" + msg);
    }
}
